<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css" href="css/mainstyle.css"/>
     <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" href="./css/themes/base/jquery.ui.all.css">
	<script src="./js/jquery-1.6.2.min.js"></script>
	<script src="./js/external/jquery.bgiframe-2.1.2.js"></script>
	<script src="./js/ui/jquery.ui.core.js"></script>
	<script src="./js/ui/jquery.ui.widget.js"></script>
	<script src="./js/ui/jquery.ui.mouse.js"></script>
	<script src="./js/ui/jquery.ui.button.js"></script>
	<script src="./js/ui/jquery.ui.draggable.js"></script>
	<script src="./js/ui/jquery.ui.position.js"></script>
	<script src="./js/ui/jquery.ui.resizable.js"></script>
	<script src="./js/ui/jquery.ui.dialog.js"></script>
    <script src="./js/ui/jquery.ui.datepicker.js"></script>
    <script src="./js/ui/i18n/jquery.ui.datepicker-zh-CN.js"></script>
    <link rel="stylesheet" href="./css/demos.css">
<title>用户帐号通话记录</title>
</head>

<script>

//页码导航 
function post_list(index,curpage,maxpage)
{ 
     if (parseInt(index) <= parseInt(maxpage) && parseInt(index) > 0  && parseInt(curpage)!= parseInt(index) )
	 {
        document.form1.action = '?action=list&curpage='+index+'&agent_id=<% $agent_id %>'; 
	    document.form1.submit(); 
	    return true;
	 }
	 return false;
}




function  change_acct_id(acct_id)
{
	    document.form1.submit(); 
	    return true;		 
	
}    
 </script>

<body>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td height="24" bgcolor="#353c44"><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                
                <td width="97%" valign="bottom"><span  align="left" class="table_caption">用户帐号通话记录 </span></td>
              </tr>
            </table></td>
            <td><div align="right"><span class="table_caption"></span>
             
             
             
             </div></td>
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
    <form name="form1" method="post" action="?action=list">
   <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
    
    
      <tr>
        <td><div align="left"><span class="STYLE6"><span class="STYLE1">代理商
                <select name="agent_id" class="STYLE1" id="agent_id" onchange= "change_acct_id(this.value)"  >
				<% if  $res_acct.accttype eq 1 %>     
                  <option  value="" > --全部-- </option>
				<% /if %>  
                  <option  value="<% $res_acct.decode_id%>"  <% if $res_acct.decode_id eq $agent_id %> selected <%/if%>>
                    <% $res_acct.acctname %>
                  </option>
                  <%foreach from=$acctchild item=eachone key=keyname %>
                  <option  value="<% $eachone.decode_id %>" <% if $eachone.decode_id eq $agent_id %> selected="selected" <%/if%> >
                    <% $eachone.acctname %>
                  </option>
                  <%/foreach%>
                </select>
                <label for="datetype2">日期</label>
                <select name="years" class="STYLE1">
                  <option value="2010" <% if $post_data.years eq 2010 %>selected<%/if%>>2010</option>
                  <option value="2011" <% if $post_data.years eq 2011 %>selected<%/if%>>2011</option>
                  <option value="2012" <% if $post_data.years eq 2012 %>selected<%/if%>>2012</option>
                  <option value="2013" <% if $post_data.years eq 2013 %>selected<%/if%>>2013</option>
                  <option value="2014" <% if $post_data.years eq 2014 %>selected<%/if%>>2014</option>
                  <option value="2015" <% if $post_data.years eq 2015 %>selected<%/if%>>2015</option>
                  <option value="2016" <% if $post_data.years eq 2016 %>selected<%/if%>>2016</option>
                  <option value="2017" <% if $post_data.years eq 2017 %>selected<%/if%>>2017</option>
                  <option value="2018" <% if $post_data.years eq 2018 %>selected<%/if%>>2018</option>
                </select>
年
<select name="month" class="STYLE1">
  <option value="01" <% if $post_data.month eq "01" %>selected<%/if%>>01</option>
  <option value="02" <% if $post_data.month eq "02" %>selected<%/if%>>02</option>
  <option value="03" <% if $post_data.month eq "03" %>selected<%/if%>>03</option>
  <option value="04" <% if $post_data.month eq "04" %>selected<%/if%>>04</option>
  <option value="05" <% if $post_data.month eq "05" %>selected<%/if%>>05</option>
  <option value="06" <% if $post_data.month eq "06" %>selected<%/if%>>06</option>
  <option value="07" <% if $post_data.month eq "07" %>selected<%/if%>>07</option>
  <option value="08" <% if $post_data.month eq "08" %>selected<%/if%>>08</option>
  <option value="09" <% if $post_data.month eq "09" %>selected<%/if%>>09</option>
  <option value="10" <% if $post_data.month eq "10" %>selected<%/if%>>10</option>
  <option value="11" <% if $post_data.month eq "11" %>selected<%/if%>>11</option>
  <option value="12" <% if $post_data.month eq "12" %>selected<%/if%>>12</option>
</select>
月
<input id="begin_day" class="STYLE1" size = "1"  title="数字-起始天数" value="<% $post_data.begin_day %>" name="begin_day"  />
日
<input id="begin_hour" class="STYLE1" size = "1"  title="数字-起始天数" value="<% $post_data.begin_hour %>" name="begin_hour"  />
点
-


<input id="end_day" class="STYLE1" size = "1"  title="数字-截至天数" value="<% $post_data.end_day %>"   name="end_day"  />
日
<input id="end_hour" class="STYLE1" size = "1"  title="数字-起始天数" value="<% $post_data.end_hour %>" name="end_hour"  />
点
<% if $res_acct.accttype eq '1' %>
<label for="dstchannel">落地</label>
<input name="dstchannel" type="text" class="STYLE1" id="dstchannel" size="12" maxlength="20" value='<% $post_data.dstchannel %>' />
<%/if%>
<label for="user_acctname">用户帐号</label>
<input name="user_acctname" type="text" class="STYLE1" id="user_acctname" size="12" maxlength="30" value='<% $post_data.user_acctname %>' />
<label for="destination_number">被叫号码</label>
<input name="destination_number" type="text" class="STYLE1" id="destination_number" size="12" maxlength="30" value='<% $post_data.destination_number %>' />
<input name="querybtn" type="submit" class="STYLE1"   id="querybtn"  value=" 查询 " />
<input name="checkbox_downloadfile" type="checkbox" class="STYLE1"   />
<label for="downloadfile">导出</label>
        </span></span></div></td>
        </tr>
        
    </table></td>
  </tr>
    </form>
     
  <tr>
    <td><table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce">
     <tr>
                          <td width="2%"  height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title"> 序号</div></td>
                          <td width="8%"  height="24"  bgcolor="d3eaef"  class="STYLE6"><div align="center" class="table_title"> 代理商</div></td>
                          <td width="8%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title"> 计费帐号</div></td>
                          <td width="8%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title"> 被叫号码</div></td>
                          <td width="14%"  height="24"  bgcolor="d3eaef"  class="STYLE6"><div align="center" class="table_title"> 开始</div></td>
                          <td width="4%"  height="24"  bgcolor="d3eaef"  class="STYLE6"><div align="center" class="table_title"> 接通</div></td>
                          <td width="4%"  height="24"  bgcolor="d3eaef"  class="STYLE6"><div align="center" class="table_title"> 挂机</div></td>
                          <td width="4%"  height="24"  bgcolor="d3eaef"  class="STYLE6"><div align="center" class="table_title"> 时长</div></td>
                          <td width="4%"  height="24"  bgcolor="d3eaef"  class="STYLE6"><div align="center" class="table_title"> 录音</div></td>
                          <td width="8%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title"> 费用(代理/用户)</div></td>
                          <td width="8%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title"> 中继IP</div></td>
                       <% if  $res_acct.accttype eq 1 %>   
                          <td width="6%" height="24"   bgcolor="d3eaef" class="STYLE6"><div align="center" class="table_title"> 中继成本</div></td>
                       <% /if %>   

                           
  </tr>     

          
          
          <% foreach from=$table_array item=eachone key=keyname %>  	
        <tr>
        
   <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
    <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%> <% $eachone.check_id %></font>  </div></td>
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
    <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>  <% $eachone.agent_acctname %></font> 
                            </div></td>
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                              <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%> <% $eachone.user_acctname %></font> 
                            </div></td>
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                             <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>  <% $eachone.destination_number %></font> 
                            </div></td>
                          
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                             <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>  <% $eachone.start_stamp|date_format:"%Y-%m-%d %T" %></font> </div></td>
                              
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                           <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>    <% $eachone.answer_stamp|date_format:"%T" %></font> </div></td>
                              
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                           <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>    <% $eachone.end_stamp|date_format:"%T" %></font> </div></td>       
                              
                      <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                          <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>     <% $eachone.billsec %></font> </div></td>       

                      <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                          <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>   
						  <% if $eachone.monitorfilename neq '' %>  
						  <a href="?action=download_post&monitorfilename=<% $eachone.monitorfilename %>&curpage=<% $curpage %>&agent_id=<% $agent_id %>">下载</a><%else%>空白<%/if%> </font> </div></td>       
                      
                       <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                             <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>  <% $eachone.costagent|string_format:"%.4f" %>/<% $eachone.costuser|string_format:"%.4f" %></font> </div></td>       
                              
                               <td height="18" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center"  class="STYLE19">
                            <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>   <% $eachone.dstchannel %></font> </div></td>       

                    <% if  $res_acct.accttype eq 1 %>     
                          <td height="20" bgcolor="<% if $keyname is even %>#FFFFFF<%else%>#F3F3F3<%/if%>"><div align="center" class="STYLE19">
                           <% if $eachone.usertype eq '3' %><font color="#0099FF"><%else%><font color="#000000"><%/if%>  <% $eachone.costgateway|string_format:"%.4f" %></font> 
                          </div></td>
                   <% /if %>         
                                  
                               
                     
                           
           </tr>
          
 
        <% /foreach %>
    </table></td>
  </tr>
  <tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="66%"><div align="left"><span class="STYLE21">共
                    <% $record_count %>
                    条记录 当前第
                    <% $curpage %>
                    /
                    <% $maxpage %>
                    页，每页
                    <% $pagelimtcount %>
                    条记录
                    总时长:<% $billsec %>秒, 用户话费:<% $costuser|string_format:"%.4f" %>元 
                    , 代理话费:<% $costagent|string_format:"%.4f" %>元 
                    <% if  $res_acct.accttype eq 1 %> 中继成本:<% $costgateway|string_format:"%.4f" %>元<%/if%>
                    
                    </span></div></td>
        <td width="34%"><table width="180" border="0" align="right" cellpadding="0" cellspacing="0">
          <tr>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('1',<% $curpage %>,'<% $maxpage %>')"  >首页</a> </div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage-1 %>','<% $curpage %>','<% $maxpage %>')" >上一页</a></div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $curpage+1 %>','<% $curpage %>','<% $maxpage %>')" >下一页</a></div></td>
            <td width="40"><div align="center"> <a href="#" class="STYLE21" onClick="return post_list('<% $maxpage  %>' ,'<% $curpage %>','<% $maxpage %>')" >尾页</a></div></td>
           
          </tr>
        </table></td>
      </tr>
    </table></td>
  </tr>
</table>

<script>
	$(function() {
		

			
	    /*日期选择*/		
  		$( "#endtime" ).datepicker( $.datepicker.regional[ "zh-CN" ] );
		$( "#begintime" ).datepicker( $.datepicker.regional[ "zh-CN" ] );
	});
		
      
</script>

</body>

</html>
